<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //与常用编程语言一致的不再演示，只写出特殊的
        var num1 = 10;
        var num2 = "10";

        //相等运算符
        console.log(num1 == num2);//true
        //严格相等运算符
        console.log(num1 === num2);//false
        console.log(num1 !== num2);//true

        //布尔运算符，&&为与，||为或，！为非
        console.log("其中！对非布尔值进行取反时以下六个值为true，其余为false")
        console.log(!undefined);
        console.log(!null);
        console.log(!false);
        console.log(!0);
        console.log(!NaN);
        console.log(!"");

        console.log(!10);
        console.log(!"0");

        //三元运算符
        num1 % 2 == 0 ? console.log("偶数") : console.log("奇数");

        var result = num2 % 2 == 0 ? "偶数" : "奇数";
        console.log(result)

    </script>
</body>

</html>